\(\int (c+d x) \text {sech}^2(a+b x) \, dx\) [33]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 29 \[ \int (c+d x) \text {sech}^2(a+b x) \, dx=-\frac {d \log (\cosh (a+b x))}{b^2}+\frac {(c+d x) \tanh (a+b x)}{b} \]

[Out]

-d*ln(cosh(b*x+a))/b^2+(d*x+c)*tanh(b*x+a)/b

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4269, 3556} \[ \int (c+d x) \text {sech}^2(a+b x) \, dx=\frac {(c+d x) \tanh (a+b x)}{b}-\frac {d \log (\cosh (a+b x))}{b^2} \]

[In]

Int[(c + d*x)*Sech[a + b*x]^2,x]

[Out]

-((d*Log[Cosh[a + b*x]])/b^2) + ((c + d*x)*Tanh[a + b*x])/b

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(c+d x) \tanh (a+b x)}{b}-\frac {d \int \tanh (a+b x) \, dx}{b} \\ & = -\frac {d \log (\cosh (a+b x))}{b^2}+\frac {(c+d x) \tanh (a+b x)}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.76 \[ \int (c+d x) \text {sech}^2(a+b x) \, dx=-\frac {d \log (\cosh (a+b x))}{b^2}+\frac {d x \text {sech}(a) \text {sech}(a+b x) \sinh (b x)}{b}+\frac {d x \tanh (a)}{b}+\frac {c \tanh (a+b x)}{b} \]

[In]

Integrate[(c + d*x)*Sech[a + b*x]^2,x]

[Out]

-((d*Log[Cosh[a + b*x]])/b^2) + (d*x*Sech[a]*Sech[a + b*x]*Sinh[b*x])/b + (d*x*Tanh[a])/b + (c*Tanh[a + b*x])/
b

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.97

method result size
risch \(\frac {2 d x}{b}+\frac {2 d a}{b^{2}}-\frac {2 \left (d x +c \right )}{b \left (1+{\mathrm e}^{2 b x +2 a}\right )}-\frac {d \ln \left (1+{\mathrm e}^{2 b x +2 a}\right )}{b^{2}}\) \(57\)
parallelrisch \(\frac {-d \ln \left (-\operatorname {sech}\left (\frac {b x}{2}+\frac {a}{2}\right )^{2}+2\right ) \cosh \left (b x +a \right )+2 \ln \left (1-\tanh \left (\frac {b x}{2}+\frac {a}{2}\right )\right ) d \cosh \left (b x +a \right )+b \left (\cosh \left (b x +a \right ) d x +\sinh \left (b x +a \right ) \left (d x +c \right )\right )}{b^{2} \cosh \left (b x +a \right )}\) \(86\)

[In]

int((d*x+c)*sech(b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

2*d/b*x+2*d/b^2*a-2*(d*x+c)/b/(1+exp(2*b*x+2*a))-d/b^2*ln(1+exp(2*b*x+2*a))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 161 vs. \(2 (29) = 58\).

Time = 0.25 (sec) , antiderivative size = 161, normalized size of antiderivative = 5.55 \[ \int (c+d x) \text {sech}^2(a+b x) \, dx=\frac {2 \, b d x \cosh \left (b x + a\right )^{2} + 4 \, b d x \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + 2 \, b d x \sinh \left (b x + a\right )^{2} - 2 \, b c - {\left (d \cosh \left (b x + a\right )^{2} + 2 \, d \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + d \sinh \left (b x + a\right )^{2} + d\right )} \log \left (\frac {2 \, \cosh \left (b x + a\right )}{\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )}\right )}{b^{2} \cosh \left (b x + a\right )^{2} + 2 \, b^{2} \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + b^{2} \sinh \left (b x + a\right )^{2} + b^{2}} \]

[In]

integrate((d*x+c)*sech(b*x+a)^2,x, algorithm="fricas")

[Out]

(2*b*d*x*cosh(b*x + a)^2 + 4*b*d*x*cosh(b*x + a)*sinh(b*x + a) + 2*b*d*x*sinh(b*x + a)^2 - 2*b*c - (d*cosh(b*x
 + a)^2 + 2*d*cosh(b*x + a)*sinh(b*x + a) + d*sinh(b*x + a)^2 + d)*log(2*cosh(b*x + a)/(cosh(b*x + a) - sinh(b
*x + a))))/(b^2*cosh(b*x + a)^2 + 2*b^2*cosh(b*x + a)*sinh(b*x + a) + b^2*sinh(b*x + a)^2 + b^2)

Sympy [F]

\[ \int (c+d x) \text {sech}^2(a+b x) \, dx=\int \left (c + d x\right ) \operatorname {sech}^{2}{\left (a + b x \right )}\, dx \]

[In]

integrate((d*x+c)*sech(b*x+a)**2,x)

[Out]

Integral((c + d*x)*sech(a + b*x)**2, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 72 vs. \(2 (29) = 58\).

Time = 0.18 (sec) , antiderivative size = 72, normalized size of antiderivative = 2.48 \[ \int (c+d x) \text {sech}^2(a+b x) \, dx=d {\left (\frac {2 \, x e^{\left (2 \, b x + 2 \, a\right )}}{b e^{\left (2 \, b x + 2 \, a\right )} + b} - \frac {\log \left ({\left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right )} e^{\left (-2 \, a\right )}\right )}{b^{2}}\right )} + \frac {2 \, c}{b {\left (e^{\left (-2 \, b x - 2 \, a\right )} + 1\right )}} \]

[In]

integrate((d*x+c)*sech(b*x+a)^2,x, algorithm="maxima")

[Out]

d*(2*x*e^(2*b*x + 2*a)/(b*e^(2*b*x + 2*a) + b) - log((e^(2*b*x + 2*a) + 1)*e^(-2*a))/b^2) + 2*c/(b*(e^(-2*b*x
- 2*a) + 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 78 vs. \(2 (29) = 58\).

Time = 0.26 (sec) , antiderivative size = 78, normalized size of antiderivative = 2.69 \[ \int (c+d x) \text {sech}^2(a+b x) \, dx=\frac {2 \, b d x e^{\left (2 \, b x + 2 \, a\right )} - d e^{\left (2 \, b x + 2 \, a\right )} \log \left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right ) - 2 \, b c - d \log \left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right )}{b^{2} e^{\left (2 \, b x + 2 \, a\right )} + b^{2}} \]

[In]

integrate((d*x+c)*sech(b*x+a)^2,x, algorithm="giac")

[Out]

(2*b*d*x*e^(2*b*x + 2*a) - d*e^(2*b*x + 2*a)*log(e^(2*b*x + 2*a) + 1) - 2*b*c - d*log(e^(2*b*x + 2*a) + 1))/(b
^2*e^(2*b*x + 2*a) + b^2)

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.72 \[ \int (c+d x) \text {sech}^2(a+b x) \, dx=\frac {2\,d\,x}{b}-\frac {2\,\left (c+d\,x\right )}{b\,\left ({\mathrm {e}}^{2\,a+2\,b\,x}+1\right )}-\frac {d\,\ln \left ({\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+1\right )}{b^2} \]

[In]

int((c + d*x)/cosh(a + b*x)^2,x)

[Out]

(2*d*x)/b - (2*(c + d*x))/(b*(exp(2*a + 2*b*x) + 1)) - (d*log(exp(2*a)*exp(2*b*x) + 1))/b^2